/**
 * @description 数据库的基本配置和连接
 * @author 盘古他爹
 */


const { Sequelize } = require("sequelize")
const dotenv = require("../config/env")
//  console.log("env,",dotenv.DATABASE, dotenv.NAME, dotenv.PASSWORD);

//  export const seq = new Sequelize(dotenv.DATABASE, dotenv.NAME, dotenv.PASSWORD, {
//     host: 'localhost',
//     dialect: "mysql",
//     timezone: "+08:00",
//   });
export const seq = new Sequelize("koa001", "root", "Zhangfengyu.324", {
  // host: 'http://47.93.221.158',
  host: 'localhost',
  dialect: "mysql",
  timezone: "+08:00",
});
// export const seq = new Sequelize("koa001", "root", "111111", {
//   host: 'localhost',
//   dialect: "mysql",
//   timezone: "+08:00",
// });









async function tt() {
  try {
    await seq.authenticate();
    console.log('连接成功');
    await seq.sync({ force: true });
    console.log(2222);
  } catch (err) {
    console.log(err);

  }
}
  // tt()

